import { Page } from '@/types/page'

export type MediaId = number

export type MediaInfo = {
  mediaId: MediaId
  status: EUploadStatus
  title: string
  ctimeFormat: number
  url: string
}
export enum EUploadStatus {
  complexing = 2,
  complexed = 0,
  complexFail = 3,
  complexReusableFail = 4,
}

/**
 * 返回数据格式
 */
export type ResPageList<T> = {
  total: number
  data: Array<T>
}

export type MediaSearchReqParam = Pick<MediaInfo, 'title'> &
  Pick<Page, 'page' | 'pageSize'> & { startTime?: string; endTime?: string }

export type MediaUploadReqParam = FormData
export type MediaRemoveReqParam = { mediaInfos: [{ mediaId: MediaId; url: string }] }
export type MediauUpdateTitleReqParam = Pick<MediaInfo, 'mediaId' | 'title'>
